Avoid a possible crash in ::activate-url handlers
authorMatthias Clasen <mclasen@redhat.com>
Thu, 29 Dec 2016 16:07:05 +0000 (11:07 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 29 Dec 2016 16:09:20 +0000 (11:09 -0500)
If the signal handler ends up changing the label text,
the link is no longer around to update the css node.
Check for this possibility to avoid a crash here.

gtk/gtklabel.c

index 9b759bea1bc9fb1d70bcd440ffc1d37a74273cf2..10e69f49bce72844dcc9289883a73d09838b17d8 100644 (file)
@@ -6611,7 +6611,8 @@ emit_activate_link (GtkLabel     *label,
   GtkStateFlags state;
 
   g_signal_emit (label, signals[ACTIVATE_LINK], 0, link->uri, &handled);
-  if (handled && priv->track_links && !link->visited)
+  if (handled && priv->track_links && !link->visited &&
+      priv->select_info && priv->select_info->links)
     {
       link->visited = TRUE;
       state = gtk_css_node_get_state (link->cssnode);